package cloud.daodao.storm.common.security.model.secret;

import cloud.daodao.storm.common.serialize.Serializer;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;
import lombok.Data;

/**
 * @author DaoDao
 */
@Schema(title = "AesSelect", description = "AES 查询")
@Data
public class AesUpsert implements Serializer {

    @Schema(title = "id", description = "id", example = "1")
    @NotEmpty
    @Size(min = 18, max = 18)
    @Pattern(regexp = "^\\d+$")
    private String id;

    @Schema(title = "AES 密钥", description = "AES 密钥", example = "0000000000000000")
    @Size(min = 16, max = 16)
    @Pattern(regexp = "^[0-9a-fA-F]{16}$")
    private String aesKey;

    @Schema(title = "AES 向量", description = "AES 向量", example = "0000000000000000")
    @Size(min = 16, max = 16)
    @Pattern(regexp = "^[0-9a-fA-F]{16}$")
    private String aesIv;

    @Schema(title = "valid", description = "是否有效", example = "true")
    private Boolean valid;

}
